
package com.idealighter.game.log.struct.roomcard.mustniuniu;

import com.idealighter.game.core.common.Game;
import com.idealighter.game.dblog.annotation.Column;
import com.idealighter.game.dblog.annotation.LogTable;
import com.idealighter.game.dblog.core.TableType;
import com.idealighter.game.log.core.PlayerLog;
import com.idealighter.game.player.service.bo.PlayerBo;
import com.idealighter.game.player.struct.Player;

/**
 * 房卡费用日志 .
 */
@LogTable(type = TableType.DAY)
public class RoomCardFeeLog extends PlayerLog {
  @Column(type = "int", size = 11, remark = "游戏")
  public final int game;
  @Column(type = "varchar", size = 24, remark = "游戏名称")
  public final String gameName;
  @Column(type = "bigint", size = 20, remark = "房间")
  public final long room;
  @Column(type = "tinyint", size = 4, remark = "由谁支付(0:房主,1:AA)")
  public final byte payBy;
  @Column(type = "bigint", size = 20, remark = "费用")
  public final long fee;
  @Column(type = "tinyint", size = 4, remark = "类型(1:扣款,0:归还)")
  public final byte type;

  /**
   * 构造函数.
   */
  public RoomCardFeeLog(Player player, Game game, long roomId, byte payBy, long fee,
      RoomCardFeeLogFeeType type) {
    super(player);
    this.game = game.getType();
    this.gameName = game.getDesc();
    this.room = roomId;
    this.payBy = payBy;
    this.fee = fee;
    this.type = type.type;
  }

  /**
   * .
   */
  public RoomCardFeeLog(PlayerBo player, Game game, long roomId, byte payBy, long fee,
      RoomCardFeeLogFeeType type) {
    super(player);
    this.game = game.getType();
    this.gameName = game.getDesc();
    this.room = roomId;
    this.payBy = payBy;
    this.fee = fee;
    this.type = type.type;
  }

  public static enum RoomCardFeeLogFeeType {
    PAY((byte) 1, "支付"), RETURN_BACK((byte) 2, "退款");

    public byte type;
    public String name;

    private RoomCardFeeLogFeeType(byte type, String name) {
      this.type = type;
      this.name = name;
    }
  }
}
